<!-- 消息咨询 -->
<template>
    <div class="infomationConsultation">
        <el-tabs v-model="activeTabs" type="card" @tab-click="handleClick">
        	<el-tab-pane v-for="(item,index) in tabsList" :label="item.label" :name="item.name" :key="index">
        		<el-form :inline="true" :model="ruleForm[item.name]" class="demo-form-inline">
					<div v-if="item.name == 'headlines'"  style="display: inline-block">
						<el-form-item label="推送终端：">
						    <el-select v-model="ruleForm[item.name].sId" filterable >
						        <el-option v-for="item in sourcelist"
						                   :key="item.id"
						                   :label="item.name"
						                   :value="item.id">
						        </el-option>
						    </el-select>
						</el-form-item>
						<el-form-item label="分类：">
						    <el-select v-model="ruleForm[item.name].typeId" filterable >
						        <el-option v-for="item in typeslist"
						                   :key="item.id"
						                   :label="item.name"
						                   :value="item.id">
						        </el-option>
						    </el-select>
						</el-form-item>
					</div>
        			<el-form-item label="发布人：">
        			    <el-input v-model="ruleForm[item.name].user" placeholder="请输入用户名称"></el-input>
        			</el-form-item>
        			<el-form-item label="发布时间：">
        				<el-date-picker
        				  v-model="ruleForm[item.name].time"
        				  type="datetimerange"
        				  range-separator="至"
        				  start-placeholder="开始日期"
        				  end-placeholder="结束日期"
        				  @change="changeDate"
        				>
        				</el-date-picker>
        			</el-form-item>
        			<div v-if="item.name == 'headlines'"  style="display: inline-block">
        				<el-form-item label="标题：">
        				    <el-input v-model="ruleForm[item.name].title" placeholder="请输入标题"></el-input>
        				</el-form-item>
					</div>
        			<el-form-item>
        			    <el-button type="primary" @click="search" id="monitorEnter">查询</el-button>
        			    <el-button type="primary" @click="$router.push({path:'/infomationConsultationDetail',query:{pageType:'add'}})">新建</el-button>
        			</el-form-item>
				</el-form>
                <div class="conentwrapper">
                   <el-table
                     :data="tableData"
                     style="width: 100%">
                     <el-table-column prop="date" label="" >
                        <template slot-scope="scope">
                            <h3 style="margin-top: 0">标题是我</h3>
                            <p>内容是我</p>
                            <div><span>June</span>|<span>永刚|2019-01-02 21:27:32</span>|<span>浏览次数：0</span></div>
                        </template>
                     </el-table-column>
                     <el-table-column prop="address"  label="">
                        <template slot-scope="scope">
                            <p>好生活好房 全国站 房产头条</p>
                        </template>
                     </el-table-column>
                    <el-table-column prop="image"  label="">
                        <template slot-scope="scope">
                                <!-- <img :src="scope.row." alt="" style="width: 100px;height: 50px;"> -->
                        </template>
                     </el-table-column>
                    <el-table-column align="center" label="" width="140">
                     <template slot-scope='scope'>
                          <p><el-button type="text" @click="operatehander('edit',scope.row)">编辑</el-button></p>
                          <p><el-button type="text" @click="operatehander('rePush',scope.row)">查看</el-button></p>
                          <p><el-button type="text" @click="operatehander('rePush',scope.row)">删除</el-button></p>
                      </template>
                    </el-table-column>
                   </el-table>
                   <div class="pagebar">
                       <el-pagination
                         background
                         layout="total, sizes, prev, pager, next"
                         :current-page.sync="ruleForm.pageNum"
                         :page-sizes="[5, 15, 20, 25]"
                         :page-size="ruleForm.pageSize"
                         @size-change="handleSizeChange"
                         @current-change="handleCurrentChange"
                         :total="ruleForm.totalSize">
                       </el-pagination>
                    </div>
                </div>
			</el-tab-pane>
        </el-tabs>


    </div>
</template>

<script>
import api from "@/api/apiPath"

export default {
    name:"infomationConsultation1",
    data() {
        return {
        	activeTabs: 'headlines',
        	ruleForm:{
        		headlines: {
        			sId:'',

        		},
        		policy: {

        		},
        		task:{

        		},
                pageNum: 0,
                pageSize: 5,
                totalSize: 0,
        	},
        	sourcelist:[
				{id:undefined,name:'全部'},
				{id:1,name:'好生活好房'},
				{id:0,name:'经纪人端'},
				{id:2,name:'管家端'},
        	],
        	typeslist:[
				{id:undefined,name:'全部'},
				{id:1,name:'房产头条'},
				{id:3,name:'房市动态'},
				{id:4,name:'新闻资讯'},
				{id:2,name:'国家政策'},
				{id:5,name:'合生专场'},
				{id:6,name:'珠江专场'}
        	],
        	tabsList: [
        	    { label: '头条', name: "headlines"},
				{ label: '政策',name: "policy"},
        	    { label: '任务', name: "task"}
        	],
        	tableData:[{},{}]


        }
    },
    created() {

    },
    mounted() {

    },
    components: {},
    methods: {
        handleCurrentChange () {
          this.getdata();
        },
        handleSizeChange (val) {
          this.ruleForm.pageSize = val
          this.getdata();
         },
    	changeDate(){

    	},
    	search(){

    	},
    	newbuilt(){

    	},
        operatehander(type,val){



        },
		handleClick(tab, event) {
		    console.log(tab.name,this.ruleForm[tab.name]);



		},

    }
}
</script>
<style lang="stylus">
    .infomationConsultation {
        .conentwrapper {
            .el-table td {
                padding: 0
            }


        }




    }
</style>
